<?php
$_RQ['op']=$_RQ['op']?$_RQ['op']:'list';
if($_RQ['op']=='list'){
		$return=array();
		$openid=$_RQ['openid']?:$_SESSION['openid'];
		$posterset=$this->plugin_setting('poster');
		$member=model('core/member')->detail($_SESSION['uid'],array('credit1','credit2','mobile','avatar','nickname'));
		$url=custom_url('jy_nongfee/member.index//mid='.$_SESSION['uid'].'&fromuser='.$_SESSION['uid'],true);
		$qr=cfc('tools')->createqrcode($url,'250',true);
		$qr=tomedia($qr);
		$image='oss/'.$_SESSION['uniacid'].'/images/jy_nongfee/wxappid'.$_SESSION['uid'].'.jpg';
		$isadd=cfc('files')->source_check($image);
		if(!$isadd && $_SESSION['wxapp_id']){
			$wxappurl='/jy_nongfee/member/index/index?mid='.$_SESSION['uid'].'&fromuser='.$_SESSION['uid'];
			$wxapp=pdo_get('core_account_wxapp',array('id'=>$_SESSION['wxapp_id'],'uniacid'=>$_SESSION['uniacid']));
			$res=model('core/wxapp')->appcode($wxappurl,$wxapp['appid'],$wxapp['appsecret'],200);
			$path='oss/'.$_SESSION['uniacid'].'/images/jy_nongfee/';
			if(!file_exists(ROOT_AT.$path)){
					mkdir(ROOT_AT.$path,0700, true);
			}
			$filename=$path.'/wxappid'.$_SESSION['uid'].'.jpg';
			$qr=cfc('files')->source_save($res,'image','png','二维码',$filename,'',$wxappurl);
		}
		$return=plugin('jy_poster')->get_active('','','',$openid,$qr,$posterset['data'],'jy_nongfee');
		$img=tomedia($return['member']['avatar']);
		$return['sharedata']=array(
			'title'=>$member['nickname'].'的海报',
			'desc'=>$member['nickname'].'的海报,欢迎浏览！！',
			'link'=>$url,
			'imgUrl'=>$img,
		);
		set_html('title',$member['nickname'].'的海报');
		exi($return);
}
?>